//
//  HBNovelMenuCell.m
//  HeartBeat
//
//  Created by karong on 2023/8/28.
//

#import "HBNovelMenuCell.h"
@interface HBNovelMenuCell ()

@property (weak, nonatomic) IBOutlet UILabel *currentChapterLabel;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *titleLabelWidth;
@property (weak, nonatomic) IBOutlet UIButton *updateBtn;
@end

@implementation HBNovelMenuCell
- (void)setDataWithObject:(HBNovelModel *)object {
    self.currentChapterLabel.text = object.newest_chapter.title;
    [self.updateBtn setTitle:SF(@"%@%@", WSLocalized(@"更新於"), [NSDate novelUpdateStringWithMSTimestamp:object.newest_chapter.updated]) forState:(UIControlStateNormal)];
    [self.updateBtn setButtonImageTitleStyle:(WSButtonImageTitleStyleRight) padding:8.5];
    self.titleLabelWidth.constant = appConfig.languageType == 2 ? 76 : 33;
    [self uploadLayout];
}
- (IBAction)moreAction:(id)sender {
    if ([self.delegate respondsToSelector:@selector(novelMenuCellMoreAction)]) {
        [self.delegate novelMenuCellMoreAction];
    }
}
@end
